#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2018/8/21 10:09
# @Author  : yangdy
# @Email   : yangdy@egu360.com
# @File    : gcd.py
# @Software: PyCharm


def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return 0
    while x % y != 0:
        x, y = y, x % y
    return y


def main():
    x, y = 3, 2
    print(x, y, ':')
    print(gcd(x, y))
    x, y = 3, 1
    print(x, y, ':')
    print(gcd(x, y))


if __name__ == '__main__':
    main()
